// SupportHanger.h: interface for the SupportHanger class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SUPPORTHANGER_H__858E6C8A_B630_4A9D_AB08_6029BC945DF7__INCLUDED_)
#define AFX_SUPPORTHANGER_H__858E6C8A_B630_4A9D_AB08_6029BC945DF7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "JointPortOwner.h"
#include <Memory>
#include <afxtempl.h>
#include "PartChain.h"
#include "ISupportHanger.h"

namespace JointSystem
{

class AFX_EXT_CLASS SupportHanger : public JointPortOwner 
{
private:
	bool GeneratePartChainFromRef();

public:
	SupportHanger();
	virtual ~SupportHanger();
	SupportHanger( SupportHanger& sh );

public:
	virtual BOOL CanAttachTo( Attachable* totherAtt );
	virtual AttachStatus AttachTo( Attachable* totherAtt );
	virtual BOOL PrepareData();
	virtual void Accept( AttachableVisitor& visitor );

public:
	AttachStatus AttachToJointPort( JointPort* refJPort );

public:
	int GetPartChainCount() const { return m_PartChains.GetSize(); }
	PartChain* GetPartChainAt( int index ) { return m_PartChains.GetAt( index ); }
	void AddPartChain( PartChain* pc );

private:
	typedef CArray<PartChain*,PartChain*> CPartChainPtrArray;
	CPartChainPtrArray m_PartChains;
};
};
#endif // !defined(AFX_SUPPORTHANGER_H__858E6C8A_B630_4A9D_AB08_6029BC945DF7__INCLUDED_)
